package com.syni.mdd.sjb.common.datatreaure.listen.appNews;

import com.syni.mdd.sjb.common.component.mybatis.dxshapp.entity.DxshAppServices;
import com.syni.mdd.sjb.common.datatreaure.service.DxshAppNewsService;
import lombok.Data;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Data
@Component
@Log4j2
public class AppBuyServiceListener implements ApplicationListener<AppBuyServiceEvent> {
    @Autowired
    DxshAppNewsService dxshAppNewsService;

    @Override
    public void onApplicationEvent(AppBuyServiceEvent appBuyServiceEvent) {
        DxshAppServices dxshAppServices = appBuyServiceEvent.getDxshAppServices();
        Double totalAmount = appBuyServiceEvent.getTotalAmount();
        log.info("收到短信购买通知：服务名：{}，用户付款：{}",dxshAppServices.getTitle(),totalAmount);
    }
}
